//企业联系人 处理窗体
Ext.define("SHApp.CompanyManage.CompanyLinkman.Form", {
    extend: "BLBTSystem.Form",
    submitUrl: "api/companylinkman?format=json",
    winWidth: 665,
    winHeight: 265,
    txtLinkmanID: "_txtLinkmanID",
    txtCompanyID: "_txtCompanyID",
    initComponent: function () {
        Ext.apply(this);
        this.txtLinkmanID += this.id;
        this.txtCompanyID += this.id;
        this.createItems();
        this.callParent(arguments);
    },
    createItems: function () {
        var me = this;
        this.items = [{
            width: 300,
            border: false,
            bodyStyle: "background:#DFE9F6",
            layout: { type: "vbox", align: "stretch" },
            items: [{
                xtype: "textfield",
                fieldLabel: "ID",
                name: "Id",
                hidden: true
            }, {
                fieldLabel: "<span style='color:red'>*</span>企业Id",
                allowBlank: false,
                blankText: "请输入企业Id!",
                xtype: "textfield",
                name: "CompanyName",
                maxLength: 50,
                id: this.txtCompanyID,
                hidden: true
            }, {
                fieldLabel: "<span style='color:red'>*</span>企业名称",
                allowBlank: false,
                blankText: "请输入企业名称!",
                xtype: "companyComboBox",
                name: "CompanyId",
                maxLength: 50,
                labelWidth: 80,
                listeners: {
                    select: function (c, r, o) {
                        if (r != null && r.length > 0) {
                            me.down("#" + me.txtCompanyID).setValue(this.getDisplayValue());
                        }
                    }
                }
            }, {
                fieldLabel: "<span style='color:red'>*</span>联系人姓名",
                allowBlank: false,
                blankText: "请输入联系人姓名!",
                xtype: "employeeComboBox",
                matchFieldWidth: true,
                name: "EmpId",
                maxLength: 50,
                labelWidth: 80,
                listeners: {
                    select: function (c, r, o) {
                        if (r != null && r.length > 0) {
                            me.down("#" + me.txtLinkmanID).setValue(r[0].data.Name);
                        }
                    }
                }
            }, {
                fieldLabel: "<span style='color:red'>*</span>办公电话",
                allowBlank: false,
                blankText: "请输入办公电话!",
                xtype: "textfield",
                name: "OfficialTel",
                maxLength: 50
            }, {
                fieldLabel: "办公移动电话",
                xtype: "textfield",
                name: "OfficialMobile",
                maxLength: 50
            }, {
                fieldLabel: "<span style='color:red'>*</span>联系邮箱",
                allowBlank: false,
                blankText: "请输入联系邮箱!",
                xtype: "textfield",
                name: "Email",
                maxLength: 50
            }, {
                fieldLabel: "部门",
                xtype: "textfield",
                name: "Department",
                maxLength: 50
            }]
        }, {
            width: 300,
            border: false,
            bodyStyle: "background:#DFE9F6",
            layout: { type: "vbox", align: "stretch" },
            items: [{
                fieldLabel: "<span style='color:red'>*</span>联系人Id",
                allowBlank: false,
                blankText: "请输入联系人Id!",
                xtype: "textfield",
                name: "EmpName",
                maxLength: 50,
                id: this.txtLinkmanID,
                hidden: true
            },  {
                fieldLabel: "职务",
                xtype: "textfield",
                name: "Position",
                maxLength: 50
            },{
                fieldLabel: "称谓",
                xtype: "textfield",
                name: "Title",
                maxLength: 50
            }, {
                fieldLabel: "上级职务",
                xtype: "textfield",
                name: "SuperiorPositon",
                maxLength: 50
            }, {
                fieldLabel: "上级姓名",
                xtype: "textfield",
                name: "SuperiorName",
                maxLength: 50
            }, {
                fieldLabel: "备注",
                xtype: "textfield",
                name: "Remark",
                maxLength: 150
            }]
        }
		];
    }
})